import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import My from '@/views/My'
import Login from '@/views/Login'
import Logon from '@/views/Logon'
import FindHouse from '@/views/FindHouse'
import Map from '@/views/Map'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout/home'
  },
  {
    path: '/layout',
    component: Layout,
    children: [
      {
        path: '/layout/home',
        component: Home
      },
      {
        path: '/layout/my',
        component: My
      },
      {
        path: '/layout/findhouse',
        component: FindHouse
      }
    ]
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/logon',
    component: Logon
  },
  {
    path: '/map',
    component: Map
  }

]

const router = new VueRouter({
  routes
})

export default router
